/*
 * Created on Feb 25, 2005
 *
 */
package net.jxta.myjxta.plugins.tictactoe;

import net.jxta.myjxta.MyJXTA;
import net.jxta.myjxta.View;
import net.jxta.myjxta.dialog.OneToOneCommandDialog;
import net.jxta.myjxta.plugin.PluginView;
import net.jxta.myjxta.util.Group;
import net.jxta.protocol.PipeAdvertisement;
import net.jxta.util.JxtaBiDiPipe;

import java.util.logging.Logger;

/**
 * @author Ravi
 */


public final class TicTacToeDialog extends OneToOneCommandDialog {


    public static final String IMFREE_DIALOG_NAME = IMFREE + "TicTacToeDialog";
    public static final String DIALOG_NAME = IMFREE_DIALOG_NAME;

    private static final Logger LOG = Logger.getLogger(TicTacToeDialog.class.getName());
    private boolean m_locallyInitiated = false;

    /**
     * @param group
     * @param pa
     * @param myJxta
     */
    public TicTacToeDialog(Group group, PipeAdvertisement pa, MyJXTA myJxta) {
        super(group, pa, myJxta);
        LOG.log(java.util.logging.Level.INFO, "new dialog for " + pa.getName());
    }

    public PluginView getDialogPanel(View p_myJXTAView) {
        return new TicTacToeDialogView(p_myJXTAView, this, m_locallyInitiated);
    }

    /**
     * @param group
     * @param pipe
     * @param myJxta
     */
    public TicTacToeDialog(Group group, JxtaBiDiPipe pipe, MyJXTA myJxta) {
        super(group, pipe, myJxta);
        LOG.log(java.util.logging.Level.INFO,
                "new dialog for " + pipe.getPipeAdvertisement().getName());
    }

    public void setLocallyInitiated(boolean p_b) {
        m_locallyInitiated = p_b;
    }


    public String getName() {
        return super.getName()+m_locallyInitiated;    //To change body of overridden methods use File | Settings | File Templates.
    }
}
